﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sami_SMS_CRM_Business
{
    class SubscriberClassificationCompare : IEqualityComparer<crm_subscriber_classification>
    {

        public bool Equals(crm_subscriber_classification x, crm_subscriber_classification y)
        {
            //Check whether the compared objects reference the same data. 
            if (Object.ReferenceEquals(x, y)) return true;

            //Check whether any of the compared objects is null. 
            if (Object.ReferenceEquals(x, null) || Object.ReferenceEquals(y, null))
                return false;

            //Check whether the object' properties are equal. 
            return x.guid_key == y.guid_key;
        }

        public int GetHashCode(crm_subscriber_classification obj)
        {
            //Check whether the object is null 
            if (Object.ReferenceEquals(obj, null)) return 0;

            //Get hash code for the guid_key field if it is not null. 
            return  obj.guid_key == null ? 0 : obj.guid_key.GetHashCode();
        }
    }
}
